<!--- <cfhttp method="get" url="https://dream.csac.ca.gov/security/ApplicantLogout.aspx?mode=Logout"></cfhttp>
<cfif Len(cfhttp.FileContent) gt 0> --->
	<cflocation url="https://dream.csac.ca.gov/default.aspx" addtoken="no" />
<!--- <cfelse>
	<p>There was a problem with the CA Dream Act</p>
</cfif> --->
<cfabort>

<cfparam name="view" type="string" default="email" />
<cfparam name="action" type="string" default="" />
<cfparam name="error" type="string" default="" />
<cfparam name="mode" type="string" default="" />
<!--- workshopID go to wrapper --->
<cfparam name="workshopID" type="numeric" />
<cfparam name="email" type="string" default="" />

<cfswitch expression="#action#">
	<cfcase value="captureEmail">
		<cftry>
			<cfif mode eq "live">
				<cfif cgi.HTTP_HOST eq "calgrants.org" OR cgi.HTTP_HOST eq "www.calgrants.org">
					<cfset ds = "WMS" />
				<cfelse>
					<cfset ds = "WMS_Dev" />
				</cfif>
				<cfquery name="InsertNotificationEmail" datasource="#ds#">
					insert into Dream_Act_Notifications
					(Workshop_ID, Email)
					values
					(<cfqueryparam cfsqltype="cf_sql_integer" value="#workshopID#" null="no" />, <cfqueryparam cfsqltype="cf_sql_varchar" value="#email#" null="no" />)
				</cfquery>
			</cfif>
			<cfset view = "dreamAct" />
			<cfcatch type="any">
				<cfset view = "error">
			</cfcatch>
		</cftry>
	</cfcase>
</cfswitch>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Cash for College Workshop Wrapper</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="Cash for College Workshop Wrapper">
	<meta name="author" content="Syntric">
	<cfoutput>
		<script src="#request.pathToJQuery#" type="text/javascript"></script>
		<!--- <script src="#request.pathToJQueryUI#" type="text/javascript"></script> --->
		<script src="#request.pathToBootstrap#" type="text/javascript"></script>
		<link href="#request.pathToBootstrapCSS#" rel="stylesheet" />
		<link href="#request.pathToUI#/common.css" rel="stylesheet" />
		<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" rel="stylesheet" type="text/css" />
		<cfif Len(Trim(error)) gt 0>
			<script type="text/javascript">
				alert("#error#");
			</script>
		</cfif>
	</cfoutput>
	<style>
		.main-well {
			background-color: white;
		}
		.sub-well {
			margin-top: 40px;
			margin-bottom: 40px;
			margin-left: 20px;
			margin-right: 20px;
		}
		p.step {
			font-size: 1.2em;
			line-height: 1.4em;
		}
		.bigText {
			font-size: 2.0em;
		}
	</style>
</head>

<body style="margin-top: 20px;">

	<cfoutput>
		<div class="container-fluid">
			<div class="row-fluid">
				<div class="span12">
					<!--- <div class="well well-large main-well"> --->
					<img src="images/Cash_for_College_logo.gif" width="204" height="54" style="margin-bottom: 15px; margin-right: 10px;"><cfif mode eq "practice"><strong>Practice Mode</strong></cfif>
					<!--- </div> --->
				</div>
			</div>
			<div class="row-fluid">
				<div class="span12">
					<cfif view eq "email">
						<div class="well well-large main-well">
							<h2>CA Dream Act Notification</h2>
							<h3>Do you want us to send you an e-mail notification when the CA Dream Act application is online?</h3>
							<p>The CA Dream Act application will be online soon.  If you would like us to send you an e-mail when it is available, please enter your e-mail address below and click &quot;Notify Me&quot;.  Otherwise select &quot;No Thanks&quot; to go on to the CA Dream Act summary.</p>
							<cfform id="notifyForm" name="notifyForm" action="#script_name#" method="post">
								<cfinput type="hidden" name="action" value="captureEmail" />
								<cfinput type="hidden" name="workshopID" value="#workshopID#" />
								<cfinput type="hidden" name="mode" value="#mode#" />
								<div>
									<label>E-mail Address</label>
									<cfinput type="text" name="email" value="" validate="email" required="yes" message="E-mail Address is required and must be a valid e-mail address if you want to be notified when the CA Dream Act application is online." maxlength="100" />
								</div>
								<p><cfinput type="submit" id="nextButton" name="nextButton" value="Notify Me" class="btn btn-primary btn-large" />&nbsp;<a href="?view=dreamAct&workshopID=#workshopID#&mode=#mode#" class="btn btn-primary btn-large">No Thanks</a></p>
							</cfform>
						</div>
					<cfelseif view eq "dreamAct">
						<cfif mode eq "live" AND IsValid("email", email)>
							<div class="well well-large main-well">
								<h2>Thank you</h2>
								<p>We have saved your e-mail address and will notify you when the CA Dream Act online application is available.</p>
								<p><a href="2013-2014_California_Dream_Act_Application.pdf" class="btn btn-primary btn-large">Ok, Go To Dream Act Summary</a></p>
							</div>
						<cfelseif mode eq "practice" AND IsValid("email", email)>
							<div class="well well-large main-well">
								<h2>Thank you</h2>
								<p>The wrapper is in practice mode.  The e-mail address was not saved.</p>
								<p><a href="2013-2014_California_Dream_Act_Application.pdf" class="btn btn-primary btn-large">Ok, Go To Dream Act Summary</a></p>
							</div>
						<cfelse>
							<cflocation url="2013-2014_California_Dream_Act_Application.pdf" addtoken="no" />
						</cfif>
					<cfelseif view eq "error">
						<div class="well well-large main-well">
							<h2>Error</h2>
							<p>We are sorry but there was an error processing your request.</p>
							<p><a href="?workshopID=#workshopID#&mode=#mode#" class="btn btn-primary btn-large">Go Back</a></p>
						</div>
					</cfif>
				</div>
			</div>
		</div>
	</cfoutput>

</body>
</html>